package com.cn.mapper;

import com.cn.bean.User;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

/**
 * @Description
 * @Author Wangbo
 * @Date 2019/11/21
 * @Version V1.0
 **/
@Mapper
public interface UserMapper {

    @Select("SELECT * FROM tb_user WHERE user_nameId=#{userNameId}")
    public User findUserByName(String userNameId);

    @Select("SELECT * FROM tb_user WHERE id=#{id}")
    public User getUserById(String id);

    @Select("SELECT * FROM tb_user WHERE company_code=#{companyCode}")
    public User findUserByCompanyCode(String companyCode);

    @Select("SELECT id,user_nameId as userNameId,user_password userPassword,user_lock userLock FROM tb_user WHERE user_nameId = #{userNameId} and company_code=#{companyCode}")
    public User findUserByNameAndCode(String userNameId,String companyCode);
}
